package com.wayhome.srpingbootmybatis.boc.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.wayhome.srpingbootmybatis.boc.consts.BocOnePayConst;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class BocBaseFieldDTO {

    @JSONField(name="MsgVer")
    @JsonProperty("MsgVer")
    @ApiModelProperty(value = "报文版本")
    public String MsgVer;

    @ApiModelProperty(value = "前端系统日期", notes = "日期格式:yyyyMMdd")
    @JsonProperty("InDate")
    @JSONField(name="InDate")
    public String InDate;

    @ApiModelProperty(value = "前端系统时间", notes = "时间格式:HHmmss")
    @JsonProperty("InTime")
    @JSONField(name="InTime")
    public String InTime;

    @ApiModelProperty(value = "交易编码")
    @JsonProperty("TranId")
    @JSONField(name="TranId")
    public String TranId;

    @ApiModelProperty(value = "业务编号")
    @JsonProperty("BussId")
    @JSONField(name="BussId")
    public String BussId;

    @ApiModelProperty(value = "接入商户类型 01-普通商户 02-第三方支付机构")
    @JsonProperty("MerTp")
    @JSONField(name="MerTp")
    public String MerTp;

    @ApiModelProperty(value = "报文方向", notes = "11 请求/通知报文  12应答报文")
    @JsonProperty("Drctn")
    @JSONField(name="Drctn")
    public String Drctn;

    @ApiModelProperty(value = "商户号", notes = "当storNo(机器/门店号出现时可以不上传")
    @JsonProperty("MerId")
    @JSONField(name="MerId")
    public String MerId;

    @ApiModelProperty(value = "终端号", notes = "当storNo(机器/门店号出现时可以不上传")
    @JsonProperty("TermId")
    @JSONField(name="TermId")
    public String TermId;

    @ApiModelProperty(value = "门店号/机器号")
    @JsonProperty("StorNo")
    @JSONField(name="StorNo")
    public String StorNo;

    @ApiModelProperty(value = "唯一支付流水号")
    @JSONField(name="PayLs")
    @JsonProperty("PayLs")
    public String PayLs;

    @ApiModelProperty(value = "终端流水号", notes = "生成连续的 6 位流水号")
    @JSONField(name="TraceNo")
    @JsonProperty("TraceNo")
    public String TraceNo;

    @ApiModelProperty(value = "批次号", notes = "批次号可以当天日期为一个批次号")
    @JSONField(name="BatchNo")
    @JsonProperty("BatchNo")
    public String BatchNo;

    @ApiModelProperty(value = "外部商户订单号", notes = "请求:如前端系统存在此域则上送;回应:同请求")
    @JsonProperty("MerOrderNo")
    @JSONField(name="MerOrderNo")
    public String MerOrderNo;



    @ApiModelProperty(value = "信息备注", notes = "备注信息商户有需要时上传")
    @JSONField(name="Attach")
    @JsonProperty("Attach")
    public String Attach;

    @ApiModelProperty(value = "签名", notes = "待签名信息由以下格式组成，MerId|TermId|Payls|TraceNo\n" +
            "或者MerId 和 TermId 不存在时采用 StorNo|Payls|TraceNo|TranId")
    @JSONField(name="Sign")
    @JsonProperty("Sign")
    public String Sign;


    public String signStr() {
        return MerId + BocOnePayConst.SIGN_SPLIT + TermId + BocOnePayConst.SIGN_SPLIT + PayLs + BocOnePayConst.SIGN_SPLIT + TraceNo;
    }


}
